﻿using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.Text;

namespace NP.BPMReportPlatform.MaterialMasterData.Dto
{
    public class LBDXListingApplicationDto
    {
        [ExporterHeader(IsIgnore = true)]
        public string Url { get; set; }

        #region 主表数据

        /// <summary>
        /// 物料编码
        /// </summary>
        [ExporterHeader("9N编码")]
        public string MaterialCode { get; set; }

        /// <summary>
        /// 产品定价
        /// 移动到子行
        /// </summary>
        [ExporterHeader("产品定价")]
        public decimal Amount { get; set; }

        /// <summary>
        /// 预估人力成本（元）
        /// </summary>
        [ExporterHeader("预估人力成本（元）")]
        public decimal? EstimatedTotalHumanCost { get; set; }

        /// <summary>
        /// 预估RMCC成本（元）
        /// </summary>
        [ExporterHeader("预估RMCC成本（元）")]
        public decimal? EstimatedTotalRMCCCost { get; set; }

        /// <summary>
        /// 预估场地及其他成本（元）
        /// </summary>
        [ExporterHeader("预估场地及其他成本（元）")]
        public decimal? EstimatedTotalSitesCost { get; set; }

        /// <summary>
        /// 预估项目总成本（元）
        /// </summary>
        [ExporterHeader("预估总成本（元）")]
        public decimal EstimatedTotalProjectCost { get; set; }

        /// <summary>
        /// 预估总销售额（元）
        /// </summary>
        [ExporterHeader("预估总销售额（元）")]
        public decimal EstimatedTotalSales { get; set; }

        /// <summary>
        /// 收益预估（元）
        /// </summary>
        [ExporterHeader("收益预估（元）")]
        public decimal EarningsTotalEstimate { get; set; }

        /// <summary>
        /// RMCC
        /// </summary>
        [ExporterHeader("RMCC%")]
        public decimal RMCCTotal { get; set; }

        /// <summary>
        /// 需求来源
        /// </summary>
        [ExporterHeader(IsIgnore = true)]
        public string DemandSource { get; set; }
        [ExporterHeader("需求来源")]
        public string DemandSourceText { get; set; }

        /// <summary>
        /// 预估上市区域
        /// </summary>
        [ExporterHeader("预估上市区域")]
        public string EstimatedListingArea { get; set; }

        /// <summary>
        /// 预估开班次数
        /// </summary>
        [ExporterHeader("预估开班次数")]
        public int EstimatedNumberClasses { get; set; }

        /// <summary>
        /// 预估参与次数
        /// </summary>
        [ExporterHeader("预估参与次数")]
        public int EstimatedNumberParticipations { get; set; }

        /// <summary>
        /// 流程编号 
        /// </summary>
        [ExporterHeader("流程编号")]
        public string InstanceNumber { get; set; }
        [ExporterHeader("申请人")]
        public string AddUserName { get; set; }
        [ExporterHeader("申请时间")]
        public string AddTime { get; set; }
        [ExporterHeader("流程状态")]
        public string OrderStatus { get; set; }

        /// <summary>
        /// rmcc 超出50%的原因
        /// </summary>
        [ExporterHeader("RMCC超出50%的原因")]
        public string Reason { get; set; }

        /// <summary>
        /// 项目说明与计划的 附件表 ID
        /// </summary>
        [ExporterHeader(IsIgnore = true)]
        public string ProjectPlanId { get; set; }

        /// <summary>
        /// 项目说明与计划的文件名
        /// </summary>
        [ExporterHeader("项目说明与计划")]
        public string ProjectPlanName { get; set; }

        /// <summary>
        /// 产品框架（课程框架） ID
        /// </summary>
        [ExporterHeader(IsIgnore = true)]
        public string ProductFrameworkId { get; set; }

        /// <summary>
        /// 产品框架（课程框架）名称
        /// </summary>
        [ExporterHeader("产品简介")]
        public string ProductFrameworkName { get; set; }

        /// <summary>
        /// 项目核价明细 Id
        /// </summary>
        [ExporterHeader(IsIgnore = true)]
        public string ProjectPriceDetailsId { get; set; }

        /// <summary>
        /// 项目核价明细 名称
        /// </summary>
        [ExporterHeader("项目核价明细")]
        public string ProjectPriceDetailsName { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        [ExporterHeader("产品名称")]
        public string ProductName { get; set; }

        /// <summary>
        /// 客户  Code
        /// </summary>
        [ExporterHeader(IsIgnore = true)]
        public string ClientCode { get; set; }
        [ExporterHeader(IsIgnore = true)]
        public string ClientCodeText { get; set; }

        /// <summary>
        /// 收费类型
        /// </summary>
        [ExporterHeader(IsIgnore = true)]
        public string ChargeTypeCode { get; set; }
        [ExporterHeader("收费类型")]
        public string ChargeTypeCodeText { get; set; }

        /// <summary>
        /// 培训认证中心/项目组
        /// </summary>
        [ExporterHeader(IsIgnore = true)]
        public string ProjectTeamAndSchoolCode { get; set; }
        [ExporterHeader("培训认证中心/项目组")]
        public string ProjectTeamAndSchoolCodeText { get; set; }

        /// <summary>
        /// 开课类型
        /// </summary>
        [ExporterHeader("开课类型")]
        public string CourseNature { get; set; }

        /// <summary>
        /// 课程类型
        /// </summary>
        [ExporterHeader(IsIgnore = true)]
        public string CourseTypeCode { get; set; }
        [ExporterHeader("课程类型")]
        public string CourseTypeCodeText { get; set; }

        /// <summary>
        /// 授课方式
        /// </summary>
        [ExporterHeader(IsIgnore = true)]
        public string TeachWayCode { get; set; }
        [ExporterHeader("授课方式")]
        public string TeachWayCodeText { get; set; }

        /// <summary>
        /// 标准讲师数
        /// </summary>
        [ExporterHeader("标准讲师数")]
        public decimal StandardTeacherCount { get; set; }

        /// <summary>
        /// 标准学生数
        /// </summary>
        [ExporterHeader("标准学生数")]
        public decimal StandardStudentCount { get; set; }

        /// <summary>
        /// 标准天数
        /// </summary>
        [ExporterHeader("标准天数")]
        public decimal Days { get; set; }

        /// <summary>
        /// 定价单位
        /// </summary>
        [ExporterHeader("定价单位")]
        public string PricingUnit { get; set; }

        /// <summary>
        /// 生效时间
        /// 移动到子行
        /// </summary>
        [ExporterHeader("生效时间")]
        public string StartDate { get; set; }

        /// <summary>
        /// 截至时间
        /// 移动到子行
        /// </summary>
        [ExporterHeader("截至时间")]
        public string EndDate { get; set; }

        /// <summary>
        /// 项目名称
        /// </summary>
        [ExporterHeader(IsIgnore = true)]
        public string ProjectName { get; set; }

        /// <summary>
        /// 包含产品数量
        /// </summary>
        [ExporterHeader(IsIgnore = true)]
        public int ContainsNumberProducts { get; set; }

        #endregion

        #region 子表数据

        /// <summary>
        /// 预估总成本（元）
        /// </summary>
        [ExporterHeader(IsIgnore = true)]
        public decimal? EstimatedProjectCost { get; set; }

        /// <summary>
        /// 预估总销售额（元）
        /// </summary>
        [ExporterHeader(IsIgnore = true)]
        public decimal? EstimatedSales { get; set; }

        /// <summary>
        /// 收益预估（元）
        /// </summary>
        [ExporterHeader(IsIgnore = true)]
        public decimal? EarningsEstimate { get; set; }

        /// <summary>
        /// RMCC
        /// </summary>
        [ExporterHeader(IsIgnore = true)]
        public decimal? RMCC { get; set; }

        /// <summary>
        /// 前端排序
        /// </summary>
        [ExporterHeader(IsIgnore = true)]
        public string Key { get; set; }

        #endregion
    }

    public class LBDXListingApplicationInput : PagedAndSortedRequestDto
    {
        /// <summary>
        /// 流程实例编号
        /// </summary>
        public string InstanceNumber { get; set; }

        /// <summary>
        /// 创建者
        /// </summary>
        public string AddUserName { get; set; }


        /// <summary>
        /// 单据状态
        /// </summary>
        public List<string> OrderStatus { get; set; }

        /// <summary>
        /// 制单日期（开始节点）
        /// </summary>
        public DateTime? StartCreationTime { get; set; }

        /// <summary>
        /// 制单日期（结束节点）
        /// </summary>
        public DateTime? EndCreationTime { get; set; }

        /// <summary>
        /// 项目名称
        /// </summary>
        public string ProjectName { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        public string ProductName { get; set; }

        /// <summary>
        /// 物料编码
        /// </summary>
        public string MaterialCode { get; set; }
    }

    public class DownLoadFileInput
    {
        public List<AttachmentModel> AttachmentList { get; set; } = new List<AttachmentModel>();
    }

    public class AttachmentModel
    {
        public Guid Id { get; set; }

        public string Name { get; set; }

        public string InstanceNumber { get; set; }
    }

    public static class CodeToTextHelper
    {
        public static Dictionary<string, string> demandSourceClientCodeList = new Dictionary<string, string> {
            { "01", "TUC" },
            { "02", "TUB" },
            { "03", "刷新" },
            { "04", "厨卫" },
            { "05", "爱客" },
            { "07", "臻辅材" },
            { "08", "生产供应链" },
            { "09", "其他" },
        };

        public static Dictionary<string, string> chargeTypeCodeList = new Dictionary<string, string>
        {
            { "1", "内部收费" },
            { "2", "内部免费" },
            { "3", "外部收费" },
            { "4", "其他" },
        };

        public static Dictionary<string, string> projectTeamAndSchoolCodeList = new Dictionary<string, string>
        {
            { "ZS", "TUC" },
            { "GC", "TUB" },
            { "TU", "业务支持一组" },
            { "SX", "业务支持二组" },
            { "KC", "课程开发部" },
            { "RZ", "认证规划组" },
            { "YY", "运营组" },
            { "SH", "华东-上海" },
            { "NJ", "华东-南京" },
            { "GZ", "华南-广州" },
            { "CD", "西部-成都" },
            { "KM", "西部-昆明" },
            { "LF", "华北-廊坊" },
            { "SY", "华北-沈阳" },
            { "JN", "中原-济南" },
            { "ZZ", "中原-郑州" },
            { "WH", "华中-武汉" }
        };

        public static Dictionary<string, string> courseTypeCodeList = new Dictionary<string, string>
        {
            { "X", "项目类" },
            { "T", "通识类" },
            { "M", "管理类" },
            { "Z", "专业类" },
            { "G", "工具类" },
            { "R", "认证类" },
            { "C", "资讯类" },
            { "Q", "其他" }
        };

        public static Dictionary<string, string> teachWayCodeList = new Dictionary<string, string>
        {
            { "1", "线上" },
            { "2", "线下" },
            { "3", "线上+线下" },
            { "4", "视频微课" }
        };
    }
}
